#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    float arr[25];
    for (int i = 0; i < 25; i++)
    {
        scanf("%f", &arr[i]);
    }
    for (int j = 0; j < 25; j++)
    {
        printf("%.1f ", arr[j]);
        if ((j + 1) % 5 == 0)
            printf("%.1f\n", arr[j] + arr[j - 4] + arr[j - 3] + arr[j - 2] + arr[j - 1]);
    }

    return 0;
}